/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.crab.entity;

import java.util.Date;

import org.hibernate.validator.constraints.Length;

import com.kaaction.common.persistence.DataEntity;
import com.kaaction.common.utils.excel.annotation.ExcelField;

/**
 * 短信历史Entity
 * @author huanghaiming
 * @version 2017-07-24
 */
public class MsgHistroy extends DataEntity<MsgHistroy> {
	
	private static final long serialVersionUID = 1L;
	private String orderId;		// 订单Id
	private String mobile;		// 用户手机号
	private String content;		// 推送内容
	private String state;		// 推送结果
	private String stateStr;		// 推送结果
	private Date createDate;	// 创建日期
	
	public MsgHistroy() {
		super();
	}

	public MsgHistroy(String id){
		super(id);
	}
	
	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	@Length(min=1, max=32, message="用户手机号长度必须介于 1 和 32 之间")
	@ExcelField(title="手机号", align=2, sort=1)
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@ExcelField(title="推送内容", align=2, sort=7)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Length(min=1, max=1, message="推送结果长度必须介于 1 和 1 之间")
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	
	@ExcelField(title="推送结果", align=2, sort=10)
	public String getStateStr() {
		String str = "";
		
		if("0".equals(stateStr)){
			str = "成功";
		}else if("1".equals(stateStr)){
			str = "失败";
		}
		return str;
	}

	public void setStateStr(String stateStr) {
		this.stateStr = stateStr;
	}

	@ExcelField(title="推送时间", align=2, sort=4)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	
}